<template>
  <div>
    <HfBatchSelectTransfer
      :loading="loading"
      data-url="/sale/hfSalePrice/codePrintList"
      @change="handleDataChange"
      ref="batchSelectTransferRef"
    >
      <template #action>
        <a-space>
          <a-button type='primary' @click="handleGenerate('100x80')">
            生成标签(100x80)
          </a-button>
          <a-button type='primary' @click="handleGenerate('2x2')">
            生成标签(2x2)
          </a-button>
          <a-button type='primary' @click="handleGenerate('2x3')">
            生成标签(2x3)
          </a-button>
          <a-button icon='reset' type='primary' @click='handleReset()'>
            重置
          </a-button>
        </a-space>
      </template>
    </HfBatchSelectTransfer>
  </div>
</template>

<script>
import HfMaterialSearchSelectTag from '@comp/HfManual/HfMaterialSearchSelectTag.vue'
import { downloadFile, postAction } from '@api/manage'
import HfBatchSelectTransfer from '@comp/HfManual/HfBatchSelectTransfer.vue'

export default {
  name: 'BatchCodePrint',
  components: {
    HfBatchSelectTransfer,
    HfMaterialSearchSelectTag
  },
  data() {
    return {
      loading: false,
      url: {
        generateBatchOutboundPdfSmall: '/label/generateBatchOutboundPdfSmall',
        generateBatchOutboundPdfLarge: '/label/generateBatchOutboundPdfLarge'
      },
      selectedData: []
    }
  },
  watch: {},
  methods: {
    handleDataChange(data) {
      this.selectedData = data
    },
    handleGenerate(type) {
      this.$refs.batchSelectTransferRef.handleGenerate(type)
    },
    handleReset() {
      this.$refs.batchSelectTransferRef.handleReset()
    }
  }
}
</script>
<style scoped></style>
